package com.syezon.wifikey.analysis;

import com.syezon.wifikey.ad.AdPositionEnum;
import com.syezon.wifikey.utils.Utils;
import com.umeng.analytics.MobclickAgent;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/8/28.
 */

public class AnalysisHelper {

    public static final String EVENT_EXT_SHOW = "ext_show";
    public static final String EVENT_CLICK = "click";

    /**
     * @param eventId 事件ID 计数事件统计
     */
    public static void onEvent(String eventId) {
        MobclickAgent.onEvent(Utils.getApp(), eventId);
    }

    public static void onEvent(String eventId, Map map) {
        MobclickAgent.onEvent(Utils.getApp(), eventId, map);
    }

    public static void onAdEvent(AdPositionEnum adPositionEnum, String event, String value) {
        Map<String, String> map = new HashMap();
        map.put(event, adPositionEnum.getUmengEventValuePrefix() + value);
        MobclickAgent.onEvent(Utils.getApp(), adPositionEnum.getUmengEventId(), map);
    }

    public static void reportError(Throwable throwable) {
        MobclickAgent.reportError(Utils.getApp(), throwable);
    }
}
